1 /***
2 * CallVisitVertex
3 *
4 * This basically contains the chunk of
5 * code necessary for calling the state machine.
6 */
7
8 package junit.quilt.cover.state;
9
10 import org.apache.bcel.generic.*;
11
12 import junit.quilt.cover.generic.*;
13
14 public class CallVisitVertex
15 extends BlockVertex
16 {
17 private short position = -1;
18
19 public CallVisitVertex( int fieldVar,
20 int visitRef,
21 short position ) {
22 this.position = position;
23 InstructionList il = new InstructionList();
24 InstructionList end = new InstructionList();
25 end.append( new LabeledNOP("END VISIT(" + position + ")") );
26
27 il.append( new ALOAD( fieldVar ));
28 il.append( new IFNULL( end.getStart() ));
29 il.append( new ALOAD( fieldVar ));
30 il.append( new SIPUSH( position ));
31 il.append( new INVOKEVIRTUAL( visitRef ));
32 il.append( end );
33
34 setInstructionList( il );
35
36 // ALOAD
37 // |
38 // IFNULL
39 // T/ \F
40 // | ALOAD
41 // | |
42 // | SIPUSH
43 // | |
44 // | INVOKEVIRTUAL
45 // \ /
46 // NOP
47 //
48 }
49
50 public String toString() {
51 return "[VISIT(" + position + ")]";
52 }
53
54 }
55
56
57
This page was automatically generated by Maven